// 配置变量
const authhttp_pro = {
	weapp_appid: "wx64f9b7578163b3a5", //小程序的appid
	h5_appid: "", //公众号的appid
	//测试环境
	test: {
		projectName: "野人体育赛事平台",
		baseUrl: "https://mini.mls.xinzi365.com",
		shareUrl: "https://mini.mls.xinzi365.com"
	},
	//正式
	formal: {
		projectName: "野人体育赛事平台",
		baseUrl: "https://xcx.paobianhb.com",
		shareUrl: "https://xcx.paobianhb.com"
	}
}
/**
 * 获取域名地址
 */
export function getSystemConfig() {
	// #ifdef  H5
	let host = window.location.host
	let hostname = window.location.hostname
	let hostFirst = host.split('.')[0]
	if (host == 'lt.zhaogy.s.wxjtest.cn' || hostname == 'localhost') { //测试地址
		return authhttp_pro.test
	}
	if (host == 'tj.lx.58qf.com') { //正式地址
		return authhttp_pro.formal
	}
	let type = hostFirst.slice(2, 3)
	let authhttp = authhttp_pro[type]
	return authhttp
	// #endif

	// #ifdef  MP-WEIXIN
	const wxEnv = wx.getAccountInfoSync().miniProgram.envVersion
	if (wxEnv === 'develop' || wxEnv === 'trial') { //测试或体验版
		return authhttp_pro['test']
	} else if (wxEnv === 'release') { //'正式'
		return authhttp_pro['formal']
	}
	// #endif
}
export function getAppid() {
	// #ifdef H5
	return authhttp_pro.h5_appid
	// #endif

	// #ifdef MP-WEIXIN
	return authhttp_pro.weapp_appid
	// #endif
}